﻿using System;
using System.Collections.Generic;

namespace vulnanalyzer
{
    [Serializable]
    public class Loading
    {
        private Uri uri;                //URI загружаемого файла
        private String fileName;        //Имя загружаемого файла    

        #region Properties

        public String FileName
        {
            get { return fileName; }
        }

        public Uri Uri
        {
            get { return uri; }
        }

        #endregion

        public Loading(Uri Uri, String NameOfFile)
        {
            uri = Uri;
            fileName = NameOfFile;
        }
        public Loading(String Uri, String NameOfFile)
        {
            Uri ur = new Uri(Uri);
            uri = ur;
            fileName = NameOfFile;
        }
    }


    public class ExtendedLoading
    {
        public Loading load;
        public List<DownloaderPartState> partMap;
        public bool working = false;

        public override String ToString()
        {
            return String.Format("FileName:{0}; Uri:{1}; working:{2}", load.FileName, load.Uri, working.ToString());
        }
    }


    /// <summary>
    /// Возможные состояния загрузки части 
    /// </summary>
    public enum DownloaderPartState
    {
        nonDownloaded,
        downloading,
        downloaded
    }
}
